﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="LoadBalancer.cs" company="">
//   
// </copyright>
// <summary>
//   Defines the LoadBalancer type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace F5.BigIp.LocalTrafficManager.Interfaces
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    ///     The LoadBalancer.
    /// </summary>
    public class LoadBalancer : NotifyPropertyChanged
    {
        #region Fields

        /// <summary>
        ///     The host.
        /// </summary>
        private string host;

        /// <summary>
        ///     The password.
        /// </summary>
        private string password;

        /// <summary>
        ///     The pools.
        /// </summary>
        private IList<IPool> pools;

        /// <summary>
        ///     The user name.
        /// </summary>
        private string userName;

        /// <summary>
        ///     The version.
        /// </summary>
        private string version;

        #endregion

        #region Constructors and Destructors

        /// <summary>Initializes a new instance of the <see cref="LoadBalancer"/> class.</summary>
        /// <param name="host">The host.</param>
        /// <param name="userName">The user name.</param>
        /// <param name="password">The password.</param>
        /// <exception cref="ArgumentNullException">is thrown when a method is invoked and at least one of the passed arguments is null but should never be null.</exception>
        public LoadBalancer(string host, string userName, string password)
        {
            if (string.IsNullOrEmpty(host))
            {
                throw new ArgumentNullException("host");
            }

            if (string.IsNullOrEmpty(userName))
            {
                throw new ArgumentNullException("userName");
            }

            if (string.IsNullOrEmpty(password))
            {
                throw new ArgumentNullException("password");
            }

            this.host = host;
            this.userName = userName;
            this.password = password;
        }

        #endregion

        #region Public Properties

        /// <summary>
        ///     Gets or sets the host.
        /// </summary>
        public string Host
        {
            get
            {
                return this.host;
            }

            set
            {
                this.host = value;
                this.OnPropertyChanged();
            }
        }

        /// <summary>
        ///     Gets or sets the user name.
        /// </summary>
        public string UserName
        {
            get
            {
                return this.userName;
            }

            set
            {
                this.userName = value;
                this.OnPropertyChanged();
            }
        }

        /// <summary>
        ///     Gets or sets the password.
        /// </summary>
        public string Password
        {
            get
            {
                return this.password;
            }

            set
            {
                this.password = value;
                this.OnPropertyChanged();
            }
        }

        /// <summary>
        ///     Gets or sets the version.
        /// </summary>
        public string Version
        {
            get
            {
                return this.version;
            }

            set
            {
                this.version = value;
                this.OnPropertyChanged();
            }
        }

        /// <summary>
        ///     Gets or sets the pools.
        /// </summary>
        public IList<IPool> Pools
        {
            get
            {
                return this.pools;
            }

            set
            {
                this.pools = value;
                this.OnPropertyChanged();
            }
        }

        #endregion
    }
}